In modern audio/speech signal compression technologies, frequency domain coding has been widely used in various ITU-T, MPEG, and 3 GPP standards. If bit rate is high enough, spectral sub-bands are often coded with some kinds of vector quantization (VQ) approaches; if bit rate is very low, a concept of BandWidth Extension (BWE) is well possible to be used. The BWE concept sometimes is also called High Band Extension (HBE) or SubBand Replica (SBR). BWE usually comprises frequency envelope coding, temporal envelope coding (optional), and spectral fine structure generation. The corresponding signal in time domain of fine spectral structure is usually called excitation. For low bit rate encoding/decoding algorithms including BWE, the most critical problem is to encode fast changing signals, which sometimes require special or different algorithm to increase the efficiency.
The standard ITU-T G.729.1 includes typical CELP coding algorithm, typical transform coding algorithm, and typical BWE coding algorithm; the following summarized description of the related ITU-T G.729.1 will help in later description to understand why sometimes a classification of fast signal and slow signal is needed.
General Description of ITU G.729.1
ITU G.729.1 is also called G.729EV coder which is an 8-32 kbits scalable wideband (50-7000 Hz) extension of ITU-T Rec. G.729. By default, the encoder input and decoder output are sampled at 16 000 Hz. The bitstream produced by the encoder is scalable and consists of 12 embedded layers, which will be referred to as Layers 1 to 12. Layer 1 is the core layer corresponding to a bit rate of 8 kbits. This layer is compliant with G.729 bitstream, which makes G.729EV interoperable with G.729. Layer 2 is a narrowband enhancement layer adding 4 kbits, while Layers 3 to 12 are wideband enhancement layers adding 20 kbits with steps of 2 kbits.
This coder is designed to operate with a digital signal sampled at 16000 Hz followed by conversion to 16-bit linear PCM for the input to the encoder. However, the 8000 Hz input sampling frequency is also supported. Similarly, the format of the decoder output is 16-bit linear PCM with a sampling frequency of 8000 or 16000 Hz. Other input/output characteristics should be converted to 16-bit linear PCM with 8000 or 16000 Hz sampling before encoding, or from 16-bit linear PCM to the appropriate format after decoding. The bitstream from the encoder to the decoder is defined within this Recommendation.
The G.729EV coder is built upon a three-stage structure: embedded Code-Excited Linear-Prediction (CELP) coding, Time-Domain Bandwidth Extension (TDBWE) and predictive transform coding that will be referred to as Time-Domain Aliasing Cancellation (TDAC). The embedded CELP stage generates Layers 1 and 2 which yield a narrowband synthesis (50-4000 Hz) at 8 and 12 kbits. The TDBWE stage generates Layer 3 and allows producing a wideband output (50-7000 Hz) at 14 kbits. The TDAC stage operates in the Modified Discrete Cosine Transform (MDCT) domain and generates Layers 4 to 12 to improve quality from 14 to 32 kbits. TDAC coding represents jointly the weighted CELP coding error signal in the 50-4000 Hz band and the input signal in the 4000-7000 Hz band.
The G.729EV coder operates on 20 ms frames. However, the embedded CELP coding stage operates on 10 ms frames, like G.729. As a result two 10 ms CELP frames are processed per 20 ms frame. In the following, to be consistent with the text of ITU-T Rec. G.729, the 20 ms frames used by G.729EV will be referred to as superframes, whereas the 10 ms frames and the 5 ms subframes involved in the CELP processing will be respectively called frames and subframes. In this G.729EV, TDBWE algorithm is related to our topics.
G.729.1 Encoder
A functional diagram of the encoder part is presented in FIG. 1. The encoder operates on 20 ms input superframes. By default, the input signal 101, sWB(n), is sampled at 16000 Hz. Therefore, the input superframes are 320 samples long. The input signal sWB(n) is first split into two sub-bands using a QMF filter bank defined by the filters H1(z) and H2(z). The lower-band input signal 102, sLBqmf(n), obtained after decimation is pre-processed by a high-pass filter Hh1(z) with 50 Hz cut-off frequency. The resulting signal 103, sLB(n), is coded by the 8-12 kbits narrowband embedded CELP encoder. To be consistent with ITU-T Rec. G.729, the signal sLB(n) will also be denoted s(n). The difference 104, dLB(n), between s(n) and the local synthesis 105, ŝenh(n), of the CELP encoder at 12 kbits is processed by the perceptual weighting filter WLB(z). The parameters of WLB (z) are derived from the quantized LP coefficients of the CELP encoder. Furthermore, the filter WLB (z) includes a gain compensation which guarantees the spectral continuity between the output 106, dLBw(n), of WLB (z) and the higher-band input signal 107, sHB(n). The weighted difference dLBw(n) is then transformed into frequency domain by MDCT. The higher-band input signal 108, sHBfold(n), obtained after decimation and spectral folding by (−1)n is pre-processed by a low-pass filter Hh2(z) with 3000 Hz cut-off frequency. The resulting signal sHB(n) is coded by the TDBWE encoder. The signal sHB(n) is also transformed into frequency domain by MDCT. The two sets of MDCT coefficients 109, DLBw(k), and 110, SHB(k), are finally coded by the TDAC encoder. In addition, some parameters are transmitted by the frame erasure concealment (FEC) encoder in order to introduce parameter-level redundancy in the bitstream. This redundancy allows improving quality in the presence of erased superframes.
TDBWE Encoder
The TDBWE encoder is illustrated in FIG. 2. The TDBWE encoder extracts a fairly coarse parametric description from the pre-processed and down-sampled higher-band signal 201, sHB(n). This parametric description comprises time envelope 202 and frequency envelope 203 parameters. The 20 ms input speech superframe sHB(n) (8 kHz sampling frequency) is subdivided into 16 segments of length 1.25 ms each, i.e., each segment comprises 10 samples. The 16 time envelope parameters 102, Tenv(i), i=0, . . . , 15, are computed as logarithmic subframe energies before the quantization. For the computation of the 12 frequency envelope parameters 203, Fenv(j), j=0, . . . , 11, the signal 201, sHB(n), is windowed by a slightly asymmetric analysis window. This window is 128 tap long (16 ms) and is constructed from the rising slope of a 144-tap Hanning window, followed by the falling slope of a 112-tap Hanning window. The maximum of the window is centered on the second 10 ms frame of the current superframe. The window is constructed such that the frequency envelope computation has a lookahead of 16 samples (2 ms) and a lookback of 32 samples (4 ms). The windowed signal is transformed by FFT. The even bins of the full length 128-tap FFT are computed using a polyphase structure. Finally, the frequency envelope parameter set is calculated as logarithmic weighted sub-band energies for 12 evenly spaced and equally spaced and equally wide overlapping sub-bands in the FFT domain.
G.729.1 Decoder
A functional diagram of the decoder is presented in FIG. 3. The specific case of frame erasure concealment is not considered in this figure. The decoding depends on the actual number of received layers or equivalently on the received bit rate.
If the received bit rate is:
8 kbits (Layer 1): The core layer is decoded by the embedded CELP decoder to obtain 301, ŝLB(n)=ŝ(n). Then ŝLB(n) is postfiltered into 302, ŝLBpost(n), and post-processed by a high-pass filter (HPF) into 303, ŝLBqmf(n)=ŝLBhpf(n) The QMF synthesis filterbank defined by the filters G1(z) and G2(z) generates the output with a high-frequency synthesis 304, ŝHBqmf(n), set to zero.
12 kbits (Layers 1 and 2): The core layer and narrowband enhancement layer are decoded by the embedded CELP decoder to obtain 301, ŝLB(n)=ŝenh(n), and ŝLB(n) is then postfiltered into 302, ŝLBpost(n) and high-pass filtered to obtain 303, ŝLBqmf(n)=ŝLBhpf(n) The QMF synthesis filterbank generates the output with a high-frequency synthesis 304, ŝHBqmf(n) set to zero.
14 kbits (Layers 1 to 3): In addition to the narrowband CELP decoding and lower-band adaptive postfiltering, the TDBWE decoder produces a high-frequency synthesis 305, ŝHBbwe(n) which is then transformed into frequency domain by MDCT so as to zero the frequency band above 3000 Hz in the higher-band spectrum 306, ŜHBbwe(k). The resulting spectrum 307, ŜHB(k) is transformed in time domain by inverse MDCT and overlap-add before spectral folding by (−1)n. In the QMF synthesis filterbank the reconstructed higher band signal 304, ŝHBqmf(n) is combined with the respective lower band signal 302, ŝLBqmf(n)=ŝLBpost(n) reconstructed at 12 kbits without high-pass filtering.
Above 14 kbits (Layers 1 to 4+): In addition to the narrowband CELP and TDBWE decoding, the TDAC decoder reconstructs MDCT coefficients 308, {circumflex over (D)}LBw(k) and 307, ŜHB(k), which correspond to the reconstructed weighted difference in lower band (0-4000 Hz) and the reconstructed signal in higher band (4000-7000 Hz). Note that in the higher band, the non-received sub-bands and the sub-bands with zero bit allocation in TDAC decoding are replaced by the level-adjusted sub-bands of ŜHBbwe(k). Both {circumflex over (D)}LBw(k) and ŜHB(k) are transformed into time domain by inverse MDCT and overlap-add. The lower-band signal 309, {circumflex over (d)}LBw(n) is then processed by the inverse perceptual weighting filter WLB(z)−1. To attenuate transform coding artefacts, prepost-echoes are detected and reduced in both the lower- and higher-band signals 310, {circumflex over (d)}LB(n) and 311, ŝHB(n). The lower-band synthesis ŝLB(n) is postfiltered, while the higher-band synthesis 312, ŝHBfold(n), is spectrally folded by (−1)n. The signals ŝLBqmf(n)=ŝLBpost(n) and ŝHBqmf(n) are then combined and upsampled in the QMF synthesis filterbank.
TDBWE Decoder
FIG. 4 illustrates the concept of the TDBWE decoder module. The TDBWE received parameters, which are computed by a parameter extraction procedure, are used to shape an artificially generated excitation signal 402, ŝHBexc(n), according to desired time and frequency envelopes 408, {circumflex over (T)}env(i), and 409, {circumflex over (F)}env(j). This is followed by a time-domain post-processing procedure.
The quantized parameter set consists of the value {circumflex over (M)}T and of the following vectors: {circumflex over (T)}env,1, {circumflex over (T)}env,2, {circumflex over (F)}env,1, {circumflex over (F)}env,2 and {circumflex over (F)}env,3. The quantized mean time envelope {circumflex over (M)}T is used to reconstruct the time envelope and the frequency envelope parameters from the individual vector components, i.e.:{circumflex over (T)}env(i)={circumflex over (T)}envM(i)+{circumflex over (M)}T, i=0, . . . , 15  (3)and,{circumflex over (F)}env(j)={circumflex over (F)}envM(j)+{circumflex over (M)}T, j=0, . . . , 11  (4)
The decoded frequency envelope parameters {circumflex over (F)}env(j) with j=0, . . . , 11 are representative for the second 10 ms frame within the 20 ms superframe. The first 10 ms frame is covered by parameter interpolation between the current parameter set and the parameter set {circumflex over (F)}env,old(j) from the preceding superframe:
                                                                        F                ^                                            env                ,                int                                      ⁡                          (              j              )                                =                                    1              2                        ⁢                          (                                                                                          F                      ^                                                              env                      ,                      old                                                        ⁡                                      (                    j                    )                                                  +                                                                            F                      ^                                        env                                    ⁡                                      (                    j                    )                                                              )                                      ,                  j          =          0                ,        …        ⁢                                  ,        11                            (        5        )            
The superframe of 403, ŝHBT(n), is analyzed twice per superframe. A filterbank equalizer is designed such that its individual channels match the sub-band division to realize the frequency envelope shaping with proper gain for each channel
The TDBWE excitation signal 401, exc(n), is generated by 5 ms subframe based on parameters which are transmitted in Layers 1 and 2 of the bitstream. Specifically, the following parameters are used: the integer pitch lag T0=int(T1) or int(T2) depending on the subframe, the fractional pitch lag frac, the energy Ec of the fixed codebook contributions, and the energy Ep of the adaptive codebook contribution.
The parameters of the excitation generation are computed every 5 ms subframe. The excitation signal generation consists of the following steps:
estimation of two gains gv and guv for the voiced and unvoiced contributions to the final excitation signal exc(n);
pitch lag post-processing;
generation of the voiced contribution;
generation of the unvoiced contribution; and
low-pass filtering.
In G.729.1, TDBWE is used to code the wideband signal from 4 kHz to 7 kHz. The narrow band (NB) signal from 0 to 4 kHz is coded with G.729 CELP coder where the excitation consists of adaptive codebook contribution and fixed codebook contribution. The adaptive codebook contribution comes from the voiced speech periodicity; the fixed codebook contributes to unpredictable portion. The ratio of the energies of the adaptive and fixed codebook excitations (including enhancement codebook) is computed for each subframe:
                    ξ        =                              E            p                                E            c                                              (        1        )            
In order to reduce this ratio ξ in case of unvoiced sounds, a “Wiener filter” characteristic is applied:
                              ξ          post                =                  ξ          ·                      ξ                          1              +              ξ                                                          (        2        )            
This leads to more consistent unvoiced sounds. The gains for the voiced and unvoiced contributions of exc(n) are determined using the following procedure. An intermediate voiced gain g′v is calculated by:
                              g          v          ′                =                                            ξ              post                                      1              +                              ξ                post                                                                        (        3        )            
which is slightly smoothed to obtain the final voiced gain gv:
                              g          v                =                                            1              2                        ⁢                          (                                                g                  v                  ′2                                +                                  g                                      v                    ,                    old                                    ′2                                            )                                                          (        4        )            
where g′v,old is the value of g′v of the preceding subframe.
To satisfy the constraint gv2+guv2=1, the unvoiced gain is given by:guv=√{square root over (1−gv2)}  (5)
The generation of a consistent pitch structure within the excitation signal exc(n) requires a good estimate of the fundamental pitch lag t0 of the speech production process. Within Layer 1 of the bitstream, the integer and fractional pitch lag values T0 and frac are available for the four 5 ms subframes of the current superframe. For each subframe the estimation of t0 is based on these parameters.
The aim of the G.729 encoder-side pitch search procedure is to find the pitch lag which minimizes the power of the LTP residual signal. That is, the LTP pitch lag is not necessarily identical with t0, which is a requirement for the concise reproduction of voiced speech components. The most typical deviations are pitch-doubling and pitch-halving errors, i.e., the frequency corresponding to the LTP lag is the half or double that of the original fundamental speech frequency. Especially, pitch-doubling (-tripling, etc.) errors have to be strictly avoided. Thus, the following post-processing of the LTP lag information is used. First, the LTP pitch lag for an oversampled time-scale is reconstructed from T0 and frac, and a bandwidth expansion factor of 2 is considered:tLTP=2·(3·T0+frac)  (6)
The (integer) factor between the currently observed LTP lag tLTP and the post-processed pitch lag of the preceding subframe tpost,old is calculated. The pitch lag is corrected, producing a continuous pitch lag tpost w.r.t. the previous pitch lags, which is further smoothed as:
                              t          p                =                              1            2                    ·                      (                                          t                                  post                  ,                  old                                            +                              t                post                                      )                                              (        7        )            
Note that this moving average leads to a virtual precision enhancement from a resolution of ⅓ to ⅙ of a sample. Finally, the post-processed pitch lag tp is decomposed in integer and fractional parts:
      t          0      ,      int        =                    int        ⁡                  (                                    t              p                        6                    )                    ⁢                          ⁢      and      ⁢                          ⁢              t                  0          ,          frac                      =                  t        p            -              6        ·                              t                          0              ,              int                                .                    
The voiced components 406, sexc,v(n), of the TDBWE excitation signal are represented as shaped and weighted glottal pulses. Thus sexc,v(n) is produced by overlap-add of single pulse contributions:
                                          S                          exc              ,              v                                ⁡                      (            n            )                          =                              ∑            p                    ⁢                                    g              Pulse                              [                p                ]                                      ×                                          P                                  n                                      Pulse                    ,                    frac                                                        [                    p                    ]                                                              ⁡                              (                                  n                  -                                      n                                          Pulse                      ,                      int                                                              [                      p                      ]                                                                      )                                                                        (        8        )                            where nPulse,int[p] is a pulse position, PnPulse,frac[p](n−npulse,int[p]) is the pulse shape, and gPulse[p] is a gain factor for each pulse. These parameters are derived in the following. The post-processed pitch lag parameters t0,int and t0,frac determine the pulse spacing and thus the pulse positions: nPulse,int[p] is the (integer) position of the current pulse and nPulse,int[p−1] is the (integer) position of the previous pulse, where p is the pulse counter. The fractional part of the pulse position serves as an index for the pulse shape selection. The prototype pulse shapes Pi(n) with i=0, . . . , 5 and n=0, . . . , 56 are taken from a lookup table which is plotted in FIG. 5. These pulse shapes are designed such that a certain spectral shaping, i.e., a smooth increase of the attenuation of the voiced excitation components towards higher frequencies, is incorporated and the full sub-sample resolution of the pitch lag information is utilized. Further, the crest factor of the excitation signal is strongly reduced and an improved subjective quality is obtained.        
The gain factor gPulse[p] for the individual pulses is derived from the voiced gain parameter gv and from the pitch lag parameters. Here, it is ensured that increasing pulse spacing does not decrease the contained energy. The function even( ) returns 1 if the argument is an even integer number and 0 otherwise.
The unvoiced contribution 407, sexc,uv(n), is produced using the scaled output of a white noise generator:sexc,uv(n)=guv·random(n), n=0, . . . , 39  (9)
Having the voiced and unvoiced contributions sexe,v(n) and sexe,uv(n), the final excitation signal 402, ŝHBexc(n), is obtained by low-pass filtering of exc(n)=sexe,v(n)+sexe,uv(n).
The low-pass filter has a cut-off frequency of 3000 Hz and its implementation is identical with the pre-processing low-pass filter for the high band signal.
Post-Processing of the Decoded Higher Band
For the high-band, the frequency domain (TDAC) post-processing is performed on the available MDCT coefficients at the decoder side. There are 160 higher-band MDCT coefficients which are noted as Ŷ(k), k=160, . . . , 319. For this specific post-processing, the higher band is divided into 10 sub-bands of 16 MDCT coefficients. The average magnitude in each sub-band is defined as the envelope:
                                          env            ⁡                          (              j              )                                =                                    ∑                              k                =                0                            15                        ⁢                                                                          Y                  ^                                ⁡                                  (                                      160                    +                                          15                      ⁢                      j                                        +                    k                                    )                                                                                  ,                                  ⁢                  j          =          0                ,        1        ,        …        ⁢                                  ,        9                            (        10        )            
The post-processing consists of two steps. The first step is an envelope post-processing (corresponding to short-term post-processing) which modifies the envelope; the second step is a fine structure post-processing (corresponding to long-term post-processing) which enhances the magnitude of each coefficient within each sub-band. The basic concept is to make the lower magnitudes relatively further lower, where the coding error is relatively bigger than the higher magnitudes. The algorithm to modify the envelope is described as follows. The maximum envelope value is:
                              env          max                =                              max                                          j                =                0                            ,                                                          ⁢              …              ⁢                                                          ,              9                                ⁢                                          ⁢                      env            ⁡                          (              j              )                                                          (        11        )            
Gain factors, which will be applied to the envelope, are calculated with the equation:
                                                        fac              1                        ⁡                          (              j              )                                =                                                    α                ENV                            ⁢                                                env                  ⁡                                      (                    j                    )                                                                    env                  max                                                      +                          (                              1                -                                  α                  ENV                                            )                                      ,                                  ⁢                  j          =          0                ,        …        ⁢                                  ,        9                            (        12        )                            where αENV (0<αENV<1) depends on the bit rate. The higher the bit rate, the smaller the constant αENV. After determining the factors fac1(j), the modified envelope is expressed as:env′(j)=gnormfac1(j)env(j), j=0, . . . , 9  (13)        where gnorm is a gain to maintain the overall energy. The fine structure modification within each sub-band will be similar to the above envelope post-processing. Gain factors for the magnitudes are calculated as:        
                                                        fac              2                        ⁡                          (                              j                ,                k                            )                                =                                                    β                ENV                            ⁢                                                                                                            Y                      ^                                        ⁡                                          (                                              160                        +                                                  16                          ⁢                          j                                                +                        k                                            )                                                                                                                              Y                    max                                    ⁡                                      (                    j                    )                                                                        +                          (                              1                -                                  β                  ENV                                            )                                      ,                                  ⁢                  k          =          0                ,        …        ⁢                                  ,        15                            (        14        )                            where the maximum magnitude Ymax(j) within a sub-band is:        
                                          Y            max                    ⁡                      (            j            )                          =                              max                                          k                =                0                            ,                                                          ⁢              …              ⁢                                                          ,              15                                ⁢                                                                Y                ^                            ⁡                              (                                  160                  +                                      16                    ⁢                    j                                    +                  k                                )                                                                                    (        15        )                            and βENV (0<βENV<1) depends on the bit rate. The higher the bit rate, the smaller βENV. By combining both the envelope post-processing and the fine structure post-processing, the final post-processed higher-band MDCT coefficients are:Ŷpost(160+16j+k)=gnormfac1(j)fac2(j,k){circumflex over (Y)}(160+16j+k), j=0, . . . , 9 k=0, . . . , 15  (16)        